<template>
    <view class="pub_page pub_help">
        <pub-head headerName="demo" :headerConfig="headerConfig"></pub-head>
        <div class="page_box">
            <div class="img_div">
                <pub-image class="img_1" :src="'../../static/bimg/img_107.png'" mode="aspectFit" />
                <div class="title pub_font pub_text">帮助中心</div>
            </div>
            <div class="lis_div">
                <div class="tabs">
                    <div class="li pub_font" :class="mType == 3 ? 'li_active' : ''" @click="mTypeClick(3)">游戏问题</div>
                    <div class="li pub_font" :class="mType == 4 ? 'li_active' : ''" @click="mTypeClick(4)">船长问题</div>
                    <div class="li pub_font" :class="mType == 5 ? 'li_active' : ''" @click="mTypeClick(5)">奖励问题</div>
                </div>
                <div class="lis">
                    <div class="li" v-for="(li, key) in list" :key="key">
                        <div class="p_1 pub_font">{{ li.title }}</div>
                        <div class="p_2 pub_font">{{ li.description }}</div>
                    </div>
                    <div class="pub_nodata pub_font" v-if="list.length == 0">暂无数据</div>
                </div>
            </div>
        </div>
    </view>
</template>

<script>
export default {
    data() {
        return {
            pagescrollTop: 0,
            headerConfig: {
                title: '',//标题栏内容
                left_type: 3,
            },

            mType: 3,// 3游戏问题 4船长问题  5奖励问题 

            list: []
        };
    },
    onLoad() {
        this.getList();
    },
    onPageScroll(res) {
        this.pagescrollTop = res.scrollTop;
    },
    methods: {
        mTypeClick(type) {
            this.mType = type;
            this.getList();
        },
        async getList() {
            this.$comFun.openLoading();
            const res = await this.$request.get('public/getArchivesList', {
                type: this.mType
            });
            // console.log(res);
            this.$comFun.closeLoading();
            if (res.code == 200) {
                this.list = res.result;
            }
        },
    },
};
</script>

<style lang="scss" scoped>
@import "@/common/css/other.scss";
</style>
